<template>
	<view class="outer">
		<view>
			<image :src="data_kf.img" mode="" class="img"></image>
		</view>
		<view class="content">
			<view class="nav">客服咨询</view>
			<view class="msg">微信号 &frasl; 手机号：{{data_kf.phone}}</view>
			<button class="button" @click="copy(data_kf.phone)" size="mini">点击复制号码</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				data_kf:{
					img:'../../static/person_image/黄宗泽.png',
					phone:'18503930292'
				}
			}
		},
		methods: {
			copy(str){
			  var save = function(e){
			    e.clipboardData.setData('text/plain', str);
			    e.preventDefault();
			  }
			  document.addEventListener('copy', save);
			  document.execCommand('copy');
			  document.removeEventListener('copy',save);
			  uni.showToast({
			  	title: '已复制',
			  	duration: 2000
			  });
			}
		}
	}
	
</script>

<style lang="less" scoped>
	.outer{
		margin-top: 5rpx;
		border-top: 1px solid #DBDBDB;
		display:flex;
		flex-direction:column;
		align-items:center;
		.img{
			width: 260rpx;
			height: 200rpx;
			background-color: #F2F2F2;
			margin: 80rpx 0;
		}
		.content{
			display:flex;
			flex-direction:column;
			align-items:center;
			>view{
				margin-bottom: 30rpx;
			}
			.button{
				border:1px solid #DBDBDB;
				padding: 0 50rpx;
			}
		}
	}
	
</style>
